-
-
Notifications
You must be signed in to change notification settings - Fork 362
feat(Table): add IsGroupExtendButtons parameter #7044
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Reviewer's GuideAdds an IsGroupExtendButtons parameter to let consumers toggle between grouped or separated row extension buttons by introducing a new boolean parameter, generating dynamic CSS classes, updating the table rendering logic, extending styles, and adding unit tests. Entity relationship diagram for Table component parameterserDiagram
Table {
int DefaultFixedColumnWidth
bool IsGroupExtendButtons
}
ITable ||--o| Table : implements
IModelEqualityComparer ||--o| Table : implements
Class diagram for updated Table component with IsGroupExtendButtons parameterclassDiagram
class Table_TItem {
+int DefaultFixedColumnWidth
+bool IsGroupExtendButtons
-string? ExtendButtonGroupClassString
+GetSortTooltip(col)
}
Table_TItem --|> ITable
Table_TItem --|> IModelEqualityComparer_TItem
File-Level Changes
Assessment against linked issues
Possibly linked issues
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hey there - I've reviewed your changes - here's some feedback:
- Consider using an inline container (e.g. a or a flex utility) instead of a for the button group to avoid unexpected block‐level layout shifts.
- Make sure the new .btn-separate margin-inline-end spacing works in both LTR and RTL contexts—using logical properties for both sides may be more robust.
- The parameter name IsGroupExtendButtons is a bit verbose and could be renamed (e.g. UseGroupedExtendButtons or GroupExpandButtons) for clearer intent and consistency.
Prompt for AI Agents
Please address the comments from this code review:
## Overall Comments
- Consider using an inline container (e.g. a <span> or a flex utility) instead of a <div> for the button group to avoid unexpected block‐level layout shifts.
- Make sure the new .btn-separate margin-inline-end spacing works in both LTR and RTL contexts—using logical properties for both sides may be more robust.
- The parameter name IsGroupExtendButtons is a bit verbose and could be renamed (e.g. UseGroupedExtendButtons or GroupExpandButtons) for clearer intent and consistency.
## Individual Comments
### Comment 1
<location> `test/UnitTest/Components/TableTest.cs:2030-2033` </location>
<code_context>
});
});
+
+ cut.Contains("<div class=\"btn-group\">");
+
+ var table = cut.FindComponent<Table<Foo>>();
</code_context>
<issue_to_address>
**suggestion (testing):** Missing assertion for the result of 'cut.Contains'.
Add an assertion for 'cut.Contains' to verify the expected HTML is present and ensure test failures are detected.
```suggestion
Assert.True(cut.Contains("<div class=\"btn-group\">"), "Expected btn-group div to be present in the rendered output.");
var table = cut.FindComponent<Table<Foo>>();
Assert.NotNull(table);
```
</issue_to_address>
### Comment 2
<location> `test/UnitTest/Components/TableTest.cs:2039` </location>
<code_context>
+ {
+ pb.Add(a => a.IsGroupExtendButtons, false);
+ });
+ cut.Contains("<div class=\"btn-separate\">");
}
</code_context>
<issue_to_address>
**suggestion (testing):** Missing assertion for the result of 'cut.Contains' after changing IsGroupExtendButtons.
Add an assertion to check that the rendered HTML matches expectations when IsGroupExtendButtons is false.
</issue_to_address>Help me be more useful! Please click 👍 or 👎 on each comment and I'll use the feedback to improve your reviews.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #7044 +/- ##
=========================================
Coverage 100.00% 100.00%
=========================================
Files 743 743
Lines 32475 32480 +5
Branches 4500 4500
=========================================
+ Hits 32475 32480 +5
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds a new parameter IsGroupExtendButtons to the Table component to allow controlling whether row extend buttons are displayed as a button group or as separate buttons with spacing. By default, buttons remain grouped (maintaining backward compatibility).
Key changes:
- Added
IsGroupExtendButtonsparameter with a default value oftrueto maintain existing behavior - Introduced
ExtendButtonGroupClassStringproperty that conditionally appliesbtn-grouporbtn-separateCSS classes - Added CSS styling for
.btn-separateto apply spacing between buttons
Reviewed Changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.
| File | Description |
|---|---|
| src/BootstrapBlazor/Components/Table/Table.razor.cs | Adds IsGroupExtendButtons parameter and ExtendButtonGroupClassString computed property |
| src/BootstrapBlazor/Components/Table/Table.razor | Updates button container elements to use dynamic CSS class from ExtendButtonGroupClassString |
| src/BootstrapBlazor/Components/Table/Table.razor.scss | Adds styling for .btn-separate class with margin spacing |
| test/UnitTest/Components/TableTest.cs | Adds test assertions to verify both button group and separate button rendering |
Comments suppressed due to low confidence (62)
test/UnitTest/Components/TableTest.cs:5346
- The contents of this container are never accessed.
var selectedRows = new List<Foo>();
src/BootstrapBlazor/Components/Table/Table.razor.cs:1175
- Poor error handling: empty catch block.
catch { }
src/BootstrapBlazor/Components/Table/Table.razor.cs:1343
- Poor error handling: empty catch block.
catch (TaskCanceledException) { }
test/UnitTest/Components/TableTest.cs:5107
Assert.NotNull(col.Template);
test/UnitTest/Components/TableTest.cs:5147
Assert.NotNull(col.EditTemplate);
test/UnitTest/Components/TableTest.cs:5172
Assert.NotNull(col.SearchTemplate);
test/UnitTest/Components/TableTest.cs:328
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.ShowSkeleton, true);
pb.Add(a => a.Items, Foo.GenerateFoo(localizer));
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:349
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.ShowLoadingInFirstRender, false);
pb.Add(a => a.Items, Foo.GenerateFoo(localizer));
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:451
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:452
- This assignment to searchModel is useless, since its value is never read.
var searchModel = new FooSearchModel();
test/UnitTest/Components/TableTest.cs:1096
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:1147
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:1298
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.IsPagination, true);
pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
pb.Add(a => a.PageItems, 2);
pb.Add(a => a.ShowGotoNavigator, true);
pb.Add(a => a.GotoTemplate, builder =>
{
templated = true;
});
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:1324
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.IsPagination, true);
pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
pb.Add(a => a.PageItems, 2);
pb.Add(a => a.ShowGotoNavigator, true);
pb.Add(a => a.GotoNavigatorLabelText, "Test_GotoNavigatorLabelText");
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:1355
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:1814
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.Items, Foo.GenerateFoo(localizer, 1));
pb.Add(a => a.ColumnMinWidth, 100);
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", foo.Name);
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.AddAttribute(3, nameof(TableColumn<Foo, string>.Fixed), true);
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:1895
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.Items, Foo.GenerateFoo(localizer, 2));
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", foo.Name);
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", foo.Name);
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", foo.Name);
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", foo.Address);
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Address", typeof(string)));
builder.AddAttribute(3, nameof(TableColumn<Foo, string>.Fixed), true);
builder.CloseComponent();
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", foo.Address);
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Address", typeof(string)));
builder.AddAttribute(3, nameof(TableColumn<Foo, string>.Fixed), true);
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:2766
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:3227
- This assignment to name is useless, since its value is never read.
name = name = cut.Find("td").TextContent;
test/UnitTest/Components/TableTest.cs:3259
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.ShowFilterHeader, true);
pb.Add(a => a.IsDetails, true);
pb.Add(a => a.DetailRowTemplate, foo => builder => builder.AddContent(0, foo.Name));
pb.Add(a => a.IsMultipleSelect, true);
pb.Add(a => a.ShowLineNo, true);
pb.Add(a => a.ShowExtendButtons, true);
pb.Add(a => a.IsExtendButtonsInRowHeader, true);
pb.Add(a => a.ShowCheckboxText, showCheckboxText);
pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:3285
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.IsFixedHeader, fixedHeader);
pb.Add(a => a.ShowFilterHeader, true);
pb.Add(a => a.ShowExtendButtons, true);
pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:4495
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<TableExtensionButton>(pb =>
{
pb.Add(a => a.ChildContent, builder =>
{
builder.OpenComponent<MockButton>(0);
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:4759
- This assignment to column is useless, since its value is never read.
var column = cut.FindComponent<TableColumn<Foo, string>>();
test/UnitTest/Components/TableTest.cs:5338
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<FooNoKeyTree>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.OnQueryAsync, options =>
{
var data = new QueryData<FooNoKeyTree>()
{
Items = items,
TotalCount = 80
};
return Task.FromResult(data);
});
pb.Add(a => a.SelectedRows, selectedRows);
pb.Add(a => a.IsMultipleSelect, true);
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:5346
- This assignment to selectedRows is useless, since its value is never read.
var selectedRows = new List<Foo>();
test/UnitTest/Components/TableTest.cs:6225
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.OnQueryAsync, op =>
{
sortList.AddRange(op.SortList!);
return OnQueryAsync(localizer, isSorted: false)(op);
});
pb.Add(a => a.SortString, "Name Desc, Count");
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
builder.OpenComponent<TableColumn<Foo, int>>(0);
builder.AddAttribute(1, "Field", 1);
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Count", typeof(int)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:6236
- This assignment to items is useless, since its value is never read.
var items = Foo.GenerateFoo(localizer, 2);
test/UnitTest/Components/TableTest.cs:6263
- This assignment to items is useless, since its value is never read.
var items = Foo.GenerateFoo(localizer, 2);
test/UnitTest/Components/TableTest.cs:6301
- This assignment to items is useless, since its value is never read.
var items = Foo.GenerateFoo(localizer, 2);
test/UnitTest/Components/TableTest.cs:6330
- This assignment to items is useless, since its value is never read.
var items = Foo.GenerateFoo(localizer, 2);
test/UnitTest/Components/TableTest.cs:6354
- This assignment to items is useless, since its value is never read.
var items = Foo.GenerateFoo(localizer, 2);
test/UnitTest/Components/TableTest.cs:6390
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.OnQueryAsync, op =>
{
op.CustomerSearches.AddRange(new List<IFilterAction>() { new MockFilterAction() });
op.Filters.AddRange(new List<IFilterAction>() { new MockFilterAction() });
return OnQueryAsync(localizer, isAdvanceSearch: false, isFilter: false)(op);
});
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:7113
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7231
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.Items, items);
pb.Add(a => a.IsExcel, true);
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:7347
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
pb.Add(a => a.OnAfterRenderCallback, (table, firstRender) =>
{
callback = true;
return Task.CompletedTask;
});
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:7416
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7440
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7510
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.OnQueryAsync, async op =>
{
index++;
var data = await OnQueryAsync(localizer)(op);
return data;
});
pb.Add(a => a.IsAutoRefresh, true);
pb.Add(a => a.AutoRefreshInterval, 600);
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:7544
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7574
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7598
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7644
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.Items, items);
pb.Add(a => a.OnColumnCreating, cols =>
{
creating = true;
return Task.CompletedTask;
});
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:7651
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7690
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7729
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7919
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7957
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7982
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:7996
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<MockTable>(pb =>
{
pb.Add(a => a.Items, new List<Foo> { new() });
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, DateTime?>>(0);
builder.AddAttribute(1, "Field", DateTime.Now);
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "DateTime", typeof(DateTime?)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:8003
- This assignment to localizer is useless, since its value is never read.
var localizer = Context.Services.GetRequiredService<IStringLocalizer<Foo>>();
test/UnitTest/Components/TableTest.cs:8300
- This assignment to items is useless, since its value is never read.
var items = Foo.GenerateFoo(localizer, 2);
test/UnitTest/Components/TableTest.cs:8581
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<Foo>>(pb =>
{
pb.Add(a => a.OnQueryAsync, OnQueryAsync(localizer));
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:8687
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<BootstrapBlazorRoot>(pb =>
{
pb.AddChildContent<Table<MockFoo>>(pb =>
{
pb.Add(a => a.CreateItemCallback, () => new MockFoo(""));
pb.Add(a => a.OnQueryAsync, op =>
{
var items = new List<MockFoo>()
{
new("Test-1")
};
var data = new QueryData<MockFoo>()
{
Items = items,
TotalCount = items.Count,
};
return Task.FromResult(data);
});
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<MockFoo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
});
});
test/UnitTest/Components/TableTest.cs:8792
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<Table<Foo>>(pb =>
{
pb.AddCascadingValue<ISortableList>(new SortableList());
pb.Add(a => a.TableColumns, foo => builder =>
{
builder.OpenComponent<TableColumn<Foo, string>>(0);
builder.AddAttribute(1, "Field", "Name");
builder.AddAttribute(2, "FieldExpression", Utility.GenerateValueExpression(foo, "Name", typeof(string)));
builder.CloseComponent();
});
pb.Add(a => a.RenderMode, TableRenderMode.Table);
pb.Add(a => a.Items, Foo.GenerateFoo(localizer));
});
test/UnitTest/Components/TableTest.cs:44
- This assignment to cut is useless, since its value is never read.
var cut = Context.RenderComponent<Table<Foo>>(pb =>
{
pb.Add(a => a.Items, Foo.GenerateFoo(localizer));
pb.Add(a => a.OnQueryAsync, option => Task.FromResult<QueryData<Foo>>(null!));
});
test/UnitTest/Components/TableTest.cs:8852
- This assignment to propertyName is useless, since its value is never read.
var propertyName = col.GetFieldName();
test/UnitTest/Components/TableTest.cs:635
- This assignment to index is useless, since its value is never read.
builder.AddAttribute(index++, nameof(TableColumn<Foo, string>.Filterable), true);
test/UnitTest/Components/TableTest.cs:677
- This assignment to index is useless, since its value is never read.
builder.AddAttribute(index++, nameof(TableColumn<Foo, string>.FilterTemplate), new RenderFragment(pb =>
test/UnitTest/Components/TableTest.cs:718
- This assignment to index is useless, since its value is never read.
builder.AddAttribute(index++, nameof(TableColumn<Foo, string>.Filterable), true);
src/BootstrapBlazor/Components/Table/Table.razor:810
- This assignment to col is useless, since its value is never read.
@foreach (var col in GetVisibleColumns())
test/UnitTest/Components/TableTest.cs:3345
- The expression 'A == false' can be simplified to '!A'.
if (isDetails.HasValue && isDetails.Value == false)
src/BootstrapBlazor/Components/Table/Table.razor.cs:1175
- Generic catch clause.
catch { }
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Link issues
fixes #7043
Summary By Copilot
Regression?
Risk
Verification
Packaging changes reviewed?
☑️ Self Check before Merge
Summary by Sourcery
Add a new parameter to control whether row extension buttons are displayed as a grouped button group or as separate buttons
New Features: